/*
 * window.h
 *
 *  Created on: 2021年3月23日
 *      Author: root
 */

#ifndef GUI_WINDOW_H_
#define GUI_WINDOW_H_

#include <gui/widget.h>
#include <drivers/mouse.h>

namespace myos{
	namespace gui{

		class Window: public CompositeWidget,public myos::drivers::MouseEventHandle{

		protected:
			bool Dragging;
		public:
			Window(Widget* parent,myos::common::int32_t x,myos::common::int32_t y,myos::common::int32_t w,myos::common::int32_t h,
					myos::common::int8_t r,myos::common::int8_t g,myos::common::int8_t b);
			~Window();
			void OnMouseDown(myos::common::int32_t x,myos::common::int32_t y,myos::common::uint8_t button);
			void OnMouseUP(myos::common::int32_t x,myos::common::int32_t y,myos::common::uint8_t button);
			void OnMouseMove(myos::common::int32_t oldx,myos::common::int32_t oldy,myos::common::int32_t newx,myos::common::int32_t newy);

		};
	}
}



#endif /* GUI_WINDOW_H_ */
